package com.zrrd.api;

import java.util.ArrayList;
import java.util.List;

/**
 * @author WanJl
 * @version 1.0
 * @title Demo03
 * @description
 * @create 2024/3/31
 */
public class Demo03 {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();
        list.add("张三");
        list.add("李四");
        for (int i = 0; i <list.size() ; i++) {
            System.out.println(list.get(i));
        }
        System.out.println("----------------------------");
        //使用lambda表达式进行简化
        list.forEach(System.out::println);

    }
}

interface aaa{
    int 运算(int a,int b);
}
class myTest{
    public static void main(String[] args) {
        int sum= ((aaa) (a, b) -> a + b).运算(15,6);

        /*int sum=new aaa(){
            @Override
            public int 运算(int a, int b) {
                return a+b;
            }
        }.运算(15,6);*/
    }
}